using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Crossborder.Core.Core;
using Microsoft.Extensions.Configuration;
using StackExchange.Redis;

namespace Crossborder.Common.RedisModule
{
    public class RedisCore : IRedisCore
    {
        public ConnectionMultiplexer _Conn { get; set; }

        public IDatabase db { get; set; }

        public RedisCore(IConfiguration configuration)
        {
            var redisConfiguration = configuration["Redis"];
            ConfigurationOptions configurationOptions = ConfigurationOptions.Parse(redisConfiguration);
            configurationOptions.AllowAdmin = true;
            _Conn = ConnectionMultiplexer.Connect(configurationOptions);
            db = _Conn.GetDatabase();
        }
    }

    public interface IRedisCore : ISingleton
    {
        
    }
}